Make exec::without conditionally noexcept - #2213
Merged
Merged
Conversation
ericniebler
requested changes
Aug 17, 2026
| constexpr auto operator()(_Env&& __env, _Query) const noexcept | ||
| constexpr auto operator()(_Env&& __env, _Query) const noexcept( | ||
| STDEXEC::__nothrow_constructible_from< | ||
| STDEXEC::__if_c<STDEXEC::__queryable_with<_Env, _Query>, __without<_Env, _Query>, _Env>, |
Collaborator
There was a problem hiding this comment.
this isn't quite right because the function currently always returns by value, and _Env could be a reference type. Arguably, the function should either be returning a __without<_Env, _Query> or an _Env. it would probably be easiest to split this into two overloads instead of using an if constexpr.
fallintoplace
force-pushed
the
fix/without-noexcept
branch
from
August 17, 2026 08:27
1ab628e to
a72655a
Compare
ericniebler
approved these changes
Aug 18, 2026
Co-authored-by: Eric Niebler <eniebler@boost.org>
Collaborator
|
/ok to test 1897253 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
exec::withoutderive its exception specification from the selected return object construction.withoutonly stores a reference.Why
exec::withoutwas unconditionallynoexcept, even though it can move an rvalue environment into its return object. A throwing move could terminate instead of propagating the exception.Testing
build/test/exec/test.exec [env]ctest --test-dir build --output-on-failure -j 8All 953 configured tests passed.